package com.fzhucc.modules.subject.service.mapstruct;

import com.fzhucc.modules.subject.domain.dto.SubjectHighfieldsType2CreateDto;
import com.fzhucc.modules.subject.domain.dto.SubjectHighfieldsType2QueryDto;
import com.fzhucc.modules.subject.domain.entity.SubjectHighfieldsType2;
import org.mapstruct.Mapper;
import org.mapstruct.ReportingPolicy;

/**
* @website https://fzhucc.com
* @author yyg
* @since 2022-09-26 00:00:00
**/
@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
public class SubjectHighfieldsType2Mapper {
    public SubjectHighfieldsType2CreateDto toCreateDto(SubjectHighfieldsType2 entity){
        if(entity == null){
            return null;
        }
        SubjectHighfieldsType2CreateDto dto = new SubjectHighfieldsType2CreateDto();
        dto.setId(entity.getId());
        dto.setHighfields2(entity.getHighfields2());
        dto.setName(entity.getName());
        dto.setHighfields1(entity.getHighfields1());
        return dto;
    }
    public SubjectHighfieldsType2QueryDto toQueryDto(SubjectHighfieldsType2 entity){
        if(entity == null){
            return null;
        }
        SubjectHighfieldsType2QueryDto dto = new SubjectHighfieldsType2QueryDto();
        dto.setId(entity.getId());
        dto.setHighfields2(entity.getHighfields2());
        dto.setName(entity.getName());
        dto.setHighfields1(entity.getHighfields1());
        return dto;
    }

    public SubjectHighfieldsType2 toEntity(SubjectHighfieldsType2CreateDto dto){
        if(dto == null){
            return null;
        }
        SubjectHighfieldsType2 entity = new SubjectHighfieldsType2();
        entity.setId(dto.getId());
        entity.setHighfields2(dto.getHighfields2());
        entity.setName(dto.getName());
        entity.setHighfields1(dto.getHighfields1());
        return entity;
    }

    public SubjectHighfieldsType2 toEntity(SubjectHighfieldsType2QueryDto dto){
        if(dto == null){
            return null;
        }
        SubjectHighfieldsType2 entity = new SubjectHighfieldsType2();
        entity.setId(dto.getId());
        entity.setHighfields2(dto.getHighfields2());
        entity.setName(dto.getName());
        entity.setHighfields1(dto.getHighfields1());
        return entity;
    }
}